<?php

use think\facade\Route;

//首页
Route::get('/', 'index/Index/index');
//登录注册
Route::post('login', 'index/Index/login');
Route::post('register', 'index/Index/register');
Route::post('register/sendEmailCheckCode', 'index/Index/sendEmailCheckCode');
Route::post('logout', 'index/Index/logout');
//列表
Route::get('list', 'index/listPage/index');

//详情
Route::get('detail/<id>', 'index/detailPage/index');
Route::post('detail/<id>/comment', 'index/detailPage/articleComment');

//联系我们
Route::get('contact', 'index/contactPage/index');

//404
Route::get(404, 'index/notFoundPage/index');

Route::miss(function () {
    return response('资源不存在', 404);
});

//活动
Route::group('activity', function () {
    //创建
    Route::group('create', function () {
        Route::rule('view', 'index/activityPage/view','get');
        Route::rule('agreement', 'index/activityPage/agreementPart', 'get|post');
        Route::rule('theme', 'index/activityPage/themePart', 'get|post');
        Route::rule('type', 'index/activityPage/typePart', 'get|post');
        Route::rule('info', 'index/activityPage/infoPart', 'get|post');
        Route::rule('content', 'index/activityPage/contentPart', 'get|post');
        Route::rule('guest', 'index/activityPage/guestPart', 'get|post');
        Route::rule('ticket', 'index/activityPage/ticketPart', 'get|post');
        Route::rule('group', 'index/activityPage/groupPart', 'get|post');
        Route::rule('diyform', 'index/activityPage/diyformPart', 'get|post');
        Route::rule('advanced', 'index/activityPage/advancedPart', 'get|post');
        Route::rule('pay', 'index/activityPage/payPart', 'get|post');
        Route::rule('refund', 'index/activityPage/refundPart', 'get|post');
        Route::post('finish', 'index/activityPage/finish');
    });

    //详情
    Route::get('detail/<id>', 'index/activityDetail/index');

    //购买门票
    Route::post('buy_ticket', 'index/activityTicket/buy');

    //检查门票
    Route::post('check_ticket/<id>', 'index/activityDetail/check');

    //用户
    Route::group('user', function () {
        //账号密码
        Route::Rule('account', 'index/User/account', 'get|post');
        Route::post('send_email_check_code', 'index/User/sendEmailCheckCode');
        Route::Rule('password', 'index/User/password', 'get|post');
        //信息
        Route::rule('info', 'index/User/info', 'get|post');

        Route::any('user_files_dev', 'index/User/user_files_dev');
        
        //门票
        Route::get('ticket', 'index/UserTicket/index');  
        //主办单位
        Route::any('organizer','index/UserActivity/organizer');
        
        Route::get('ticket/<id>', 'index/UserTicket/detail');
        //活动
        Route::get('activity', 'index/UserActivity/index');
      
        Route::get('active_list', 'index/UserActivity/list');
        Route::get('role', 'index/UserActivity/role');  
        Route::any('active_role_add', 'index/UserActivity/active_role_add');
        Route::get('activity/<id>/allview', 'index/UserActivity/allview');
        Route::get('activity/<id>/overview', 'index/UserActivity/overview');
        Route::any('activity/<id>/theme', 'index/UserActivity/theme');
        Route::any('activity/<id>/type', 'index/UserActivity/type');
        Route::any('activity/<id>/info', 'index/UserActivity/info');
        Route::any('activity/<id>/content', 'index/UserActivity/content');
        Route::any('activity/<id>/guest', 'index/UserActivity/guest');
        Route::any('activity/<id>/ticket', 'index/UserActivity/ticket');
        Route::any('activity/<id>/group', 'index/UserActivity/group');
        Route::any('activity/<id>/advanced', 'index/UserActivity/advanced');
        Route::any('activity/<id>/diy', 'index/UserActivity/diy');
        Route::any('activity/<id>/pay', 'index/UserActivity/pay');
        Route::any('activity/<id>/refund', 'index/UserActivity/refund');
        Route::any('activity/<id>/user_ticket', 'index/UserActivity/user_ticket'); 
        Route::any('activity/<id>/user_active_par_tick', 'index/UserActivity/user_active_par_tick'); 
        Route::any('activity/<id>/user_active_par_notice', 'index/UserActivity/user_active_par_notice');
        Route::any('activity/<id>/user_allview_view', 'index/UserActivity/user_allview_view');
        Route::any('activity/<id>/user_active_par_list', 'index/UserActivity/user_active_par_list'); 
        Route::any('activity/<id>/user_active_par_notice_add', 'index/UserActivity/user_active_par_notice_add');
        Route::post('activity/offsale', 'index/UserActivity/offsale');

        //角色
        Route::any('active_role', 'index/UserActivity/active_role'); 
        Route::any('active_role_add', 'index/UserActivity/active_role_add');
    });


});

//文件上传
Route::post('api/upload', 'index/api/upload');